import request from '@/api/request'
import { IHandpicDevice } from '@/types/handpicDevice.types'
import { ResponseFormat, ResponseFormatWithRows, IPaginationFormWithCondition } from '#/http'

/**
 * @breif: 新增
 * @param {*} playload
 * @return {*}
 */
export const create = (playload: IHandpicDevice): Promise<ResponseFormat> => {
  return request.post<ResponseFormat>('/handpic-device/create', playload)
}

/**
 * @breif: 删除
 * @param {string} id
 * @return {*}
 */
export const deleteOne = (id: string): Promise<ResponseFormat> => {
  return request.delete<ResponseFormat>('/handpic-device/delete/' + id)
}

/**
 * @breif: 修改
 * @param {IHandpicDevice} playload
 * @return {*}
 */
export const update = (playload: IHandpicDevice): Promise<ResponseFormat> => {
  return request.post<ResponseFormat>('/handpic-device/update', playload)
}

/**
 * @breif: 带参数条件查询
 * @param {IPaginationFormWithCondition} playload
 * @return {*}
 */
export const findWidthCondition = (playload: IPaginationFormWithCondition): Promise<ResponseFormatWithRows> => {
  return request.post('/handpic-device/findWidthCondition', playload)
}

/**
 * @breif: 查详情
 * @param {string} id
 * @return {*}
 */
export const findById = (id: string): Promise<ResponseFormat> => {
  return request.get('/handpic-device/findById/' + id)
}
